package org.fangzz.cameramgr.cameramonitor.dto;

import org.fangzz.cameramgr.cameramonitor.model.FfmpegProcess;
import org.fangzz.cameramgr.cameramonitor.model.MonitorType;

import java.util.Date;

/**
 * Created by cengruilin on 2018/6/12.
 */
public class FfmpegProcessSummay {

    private Integer data;
    private Date createdAt;
    private boolean alive;
    private MonitorType monitorType;

    public static FfmpegProcessSummay from(FfmpegProcess process) {
        if (null == process) {
            return null;
        }

        FfmpegProcessSummay result = new FfmpegProcessSummay();
        result.setData(process.getData());
        result.setAlive(process.getProcess().isAlive());
        result.setMonitorType(process.getMonitorType());
        return result;
    }

    public MonitorType getMonitorType() {
        return monitorType;
    }

    public void setMonitorType(MonitorType monitorType) {
        this.monitorType = monitorType;
    }

    public Integer getData() {
        return data;
    }

    public void setData(Integer data) {
        this.data = data;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public boolean isAlive() {
        return alive;
    }

    public void setAlive(boolean alive) {
        this.alive = alive;
    }
}
